package com.example.cloud.model.finance;

import com.example.cloud.model.common.CommonModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.math.BigDecimal;

/**
 * Created by wangtao on 2018/7/30.
 * 划扣记录
 */
@Entity(name = "finance_deduct_record")
@Data
@EqualsAndHashCode(callSuper = false)
public class DeductRecord extends CommonModel {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    // 购买会员
    @Column(name = "patient_id")
    private Long patientId;
    // 会员主键
    @Column(name = "member_id")
    private Long memberId;
    // 会员名称
    @Column(name = "member_name")
    private String memberName;
    // 会员编号
    @Column(name = "member_number")
    private String memberNumber;
    // 治疗方案主键
    @Column(name = "treat_id")
    private Long treatId;
    // 治疗方案类型
    @Column(name = "treat_type")
    private int treatType;
    // 治疗方案名称
    @Column(name = "treat_name")
    private String treatName;
    // 业务主键
    @Column(name = "business_id")
    private Long businessId;
    // 商品主键
    @Column(name = "item_id")
    private Long itemId;
    // 商品名称
    @Column(name = "item_name")
    private String itemName;
    // 单次划扣金额
    @Column(name = "price")
    private BigDecimal price;
    // 本次划扣次数
    @Column(name = "deduct_count")
    private int deductCount;
    // 本次划扣金额
    @Column(name = "deduct_amount", precision = 12, scale = 2)
    private BigDecimal deductAmount;
    // 总划扣次数
    @Column(name = "total_deduct_count", columnDefinition = "INT DEFAULT 0")
    private int totalDeductCount;
    // 已划扣次数
    @Column(name = "ticked_count", columnDefinition = "INT DEFAULT 0")
    private int tickedCount;
}
